package com.zelin.dao.impl;

import com.zelin.dao.ClassDao;
import com.zelin.pojo.Classes;
import com.zelin.util.Application;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.sql.SQLException;
import java.util.List;

/**
 * @Auther zxh
 * @Date 2020/9/28下午 8:22
 */
public class ClassDaoImpl implements ClassDao {
    private QueryRunner queryRunner = new QueryRunner(Application.getDataSource()) ;
    @Override
    public List<Classes> find() throws SQLException {
        return queryRunner.query("select * from classes",new BeanListHandler<>(Classes.class));
    }
}
